From: Xiaofeng Wang Date: Tue, 31 Mar 2026 07:15:30 +0000 (+0800) Subject: ci: Add Rust validate targets to Justfile for local development X-Git-Tag: archive/raspbian/2026.2-1+rpi1~1^2~10^2^2~4^2~1 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=efdc101754611d3981761d033ce6422da09fd1f4;p=ostree.git ci: Add Rust validate targets to Justfile for local development Add just targets mirroring the CI Rust checks so developers can run them locally before pushing: - validate: runs both fmt and clippy checks - cargo-fmt-check: checks formatting across all crates - cargo-clippy: runs clippy with the same lint config as CI Co-Authored-By: Claude Opus 4.6 Signed-off-by: Xiaofeng Wang --- diff --git a/Justfile b/Justfile index 8f96a7dc..64840429 100644 --- a/Justfile +++ b/Justfile @@ -133,3 +133,20 @@ clang-format: # Check source files against clang-format defaults clang-format-check: {{sourcefiles}} | xargs clang-format -i --Werror --dry-run + +clippy_config := "-A clippy::all -D clippy::correctness -D clippy::suspicious -Dunused_imports -Ddead_code" + +# Run all Rust lint and format checks (mirrors CI) +validate: + just cargo-fmt-check + just cargo-clippy + +# Check Rust formatting across all crates +cargo-fmt-check: + cargo fmt -p ostree -- --check -l + for d in tests/inst tests/bootc-integration tests/xtask; do cargo fmt --manifest-path $d/Cargo.toml -- --check -l; done + +# Run cargo clippy across all crates +cargo-clippy: + cargo clippy -p ostree --features=v2022_6 -- {{clippy_config}} + for d in tests/inst tests/bootc-integration tests/xtask; do cargo clippy --manifest-path $d/Cargo.toml -- {{clippy_config}}; done